package com.tedu.api.d1_object;

public class InstanceOfDemo {
    public static void main(String[] args) {
        B b=new B();
        /*
         * instanceof后面的是类型
         * 判断b对象是否是此类型或此类型的超类
         */
        System.out.println(b instanceof Object);
        System.out.println(b instanceof A);
        System.out.println(b instanceof B);
        System.out.println(b instanceof C);


    }
}


class A{ }
class B extends A{}
class C extends B{}
